return 1;
}
-unsigned int apic_timer_irqs [NR_CPUS];
-
void smp_apic_timer_interrupt(struct xen_regs * regs)
{
ack_APIC_irq();
-
- apic_timer_irqs[smp_processor_id()]++;
perfc_incrc(apic_timer);
-
raise_softirq(AC_TIMER_SOFTIRQ);
}
{
int sum, cpu = smp_processor_id();
- sum = apic_timer_irqs[cpu];
+ sum = ac_timers[cpu].softirqs;
if ( (last_irq_sums[cpu] == sum) && watchdog_on )
{
#define DEFAULT_HEAP_LIMIT 127
-/* A timer list per CPU */
-typedef struct ac_timers_st
-{
- spinlock_t lock;
- struct ac_timer **heap;
-} __cacheline_aligned ac_timers_t;
-static ac_timers_t ac_timers[NR_CPUS];
-
+struct ac_timers ac_timers[NR_CPUS];
/****************************************************************************
* HEAP OPERATIONS.
s_time_t now;
void (*fn)(unsigned long);
+ ac_timers[cpu].softirqs++;
+
spin_lock_irq(&ac_timers[cpu].lock);
do {
for ( i = 0; i < smp_num_cpus; i++ )
{
- ac_timers[i].heap = xmalloc_array(struct ac_timer *, DEFAULT_HEAP_LIMIT+1);
- if ( ac_timers[i].heap == NULL ) BUG();
+ ac_timers[i].heap = xmalloc_array(
+ struct ac_timer *, DEFAULT_HEAP_LIMIT+1);
+ BUG_ON(ac_timers[i].heap == NULL);
+
SET_HEAP_SIZE(ac_timers[i].heap, 0);
SET_HEAP_LIMIT(ac_timers[i].heap, DEFAULT_HEAP_LIMIT);
spin_lock_init(&ac_timers[i].lock);
extern void disable_APIC_timer(void);
extern void enable_APIC_timer(void);
-/*extern struct pm_dev *apic_pm_register(pm_dev_t, unsigned long, pm_callback);*/
-/*extern void apic_pm_unregister(struct pm_dev*);*/
-
extern unsigned int watchdog_on;
-
-extern unsigned int apic_timer_irqs [NR_CPUS];
extern int check_nmi_watchdog (void);
extern unsigned int nmi_watchdog;
#ifndef _AC_TIMER_H_
#define _AC_TIMER_H_
+#include <xen/spinlock.h>
#include <xen/time.h>
struct ac_timer {
extern int reprogram_ac_timer(s_time_t timeout);
+struct ac_timers {
+ spinlock_t lock;
+ struct ac_timer **heap;
+ unsigned int softirqs;
+} __cacheline_aligned;
+extern struct ac_timers ac_timers[];
+
#endif /* _AC_TIMER_H_ */
/*